/*
 * @Author: xiaopang
 * @Date: 2025-10-16 11:16:26
 * @LastEditTime: 2025-10-17 16:37:22
 * @LastEditors: xiaopang
 */
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import UnoCSS from 'unocss/vite';
import AutoImport from 'unplugin-auto-import/vite';
import Components from 'unplugin-vue-components/vite';
import { VantResolver } from '@vant/auto-import-resolver';
import path from 'path';

// https://vite.dev/config/
export default defineConfig({
  devServer: {
    port: 7000,
    host: '0.0.0.0',
    https: false,
    proxy: {
      '/seller-test-api': {
        target: 'https://jnyp-test.njfk.cc',
        changeOrigin: true
      }
    },
    open: true
  },
  plugins: [
    vue(),
    UnoCSS(),
    AutoImport({
      imports: ['vue', 'vue-router', 'pinia'],
      dts: true
    }),
    Components({
      resolvers: [VantResolver({ importStyle: false })],
      dts: true
    })
  ],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, 'src')
    }
  }
});
